<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>

<%@ include file="/WEB-INF/jsp/common/taglib.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>salesOrder_Eidt</title>
<!-- 亦可以生成一个配置文件 -->
<script>
	var contextPath = "<c:url value='/' />";
</script>

<script src="<c:url value="/ui/jquery-1.10.2.js" />"></script>
<script src="<c:url value="/ui/jquery-migrate-1.2.1.js" />"></script>

<link rel="stylesheet" href="<c:url value="/demo/jquery.ui.all.css"/>">
<link href="<s:url value="/css/standard.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/pop_up.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/maintenance.css" />" rel="stylesheet"
	type="text/css" />
<link href="<s:url value="/css/Simplemodal.css" />" rel="stylesheet"
	type="text/css" />



<script src='<c:url value="/js/common.js" />'></script>
<script src='<c:url value="/js/common_ui.js" />'></script>
<script src='<c:url value="/js/poplayer.js" />'></script>
<script src='<c:url value="/js/maint_ui.js" />'></script>
<script src='<c:url value="/js/jquery.form.js" />'></script>
<script src="<c:url value="/js/salesorder.js" />"></script>


<script src="<c:url value="/ui/jquery.ui.core.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.widget.js" />"></script>
<script src="<c:url value="/ui/jquery.ui.datepicker.js" />"></script>
<script src="<c:url value="/ui/jquery-ui-timepicker-addon.js" />"></script>

<script src="<c:url value="/ui/jquery-ui-slide.min.js" />"></script>
<link rel="stylesheet" href="<c:url value="/demo/demos.css" />">
<link rel="stylesheet" href="<c:url value="/demo/dateTime.css" />">

<script type="text/javascript">
	$(function() {

		$('.example').datepicker({
			changeMonth : true,
			changeYear : true
		});

	})
</script>
</head>
<body>
	<form:form name="editForm" method="put">

		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr height="20px"></tr>
			<tr>
				<td width="7" align="left" valign="top" height="7"><img
					src="<s:url value="/images/corner_left_top_m.gif"/>" width="7"
					height="7" /></td>
				<td class="topBorderMain"><img
					src="<s:url value="/images/spacer.gif" />" /></td>
				<td width="7" align="right" valign="top"><img
					src="<s:url value="/images/corner_right_top_m.gif" />" /></td>
			</tr>

			<tr>
				<th colspan="4" class="mainFormTitle">客户信息_编辑</th>

			</tr>
			<tr>
				<td colspan="4" class="leftRightBorderMain">
					<table id="radiotable" class="mainGrid" width="100%" border="0"
						cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th width="150px">编号</th>
								<th width="100px">客户</th>
								<th width="150px">销售员</th>
								<th width="180px">金额</th>
								<th width="120px">日期</th>

							</tr>
						</thead>
						<tbody>
							<tr id="radiotable_tr">

								<td align='center' style="word-break: break-all;"><input
									name="orderCode" value="${ salesOrder.orderCode }">
									<input name="id" value="${ salesOrder.id }" type="hidden" readonly="readonly" >
								</td>


								<td align='center' style="word-break: break-all;"><input  readonly="readonly"
									name="customerName" value="${ salesOrder.customerName }"
									id="customerName">
									<input type="hidden" id="customerId" name="customerId" readonly="readonly"
									value="${salesOrder.customerId }"></td>

								<td align='center' style="word-break: break-all;"><input  readonly="readonly"
									name="employeeInfoName"
									value="${ salesOrder.employeeInfoName }" id="employeeInfoName">
									
									<input type="hidden" id="employeeInfoId" name="employeeInfoId" readonly="readonly"
									value="${salesOrder.employeeInfoId }"></td>

								<td align='center'
									style="word-break: break-all; text-align: center;"><input
									name="sumCost" value="${salesOrder.sumCost}" id="sumCost" readonly="readonly"
									style="text-align: center;"></td>

								<td align='center' style="word-break: break-all;"><input readonly="readonly"
									name="orderCreateTime" value="<fmt:formatDate
											value="${ salesOrder.orderCreateTime }" pattern="MM/dd/yyyy" />"
									id="orderCreateTime" class="example"></td>

							</tr>

						</tbody>
					</table>
				</td>
			</tr>
			<tr>
				<th colspan="4" class="mainFormbtn" style="height: 15px"></th>

			</tr>
			<tr>
				<td align="left" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_left_bottom_m.gif"/>" /></td>
				<td class="bottomBorderMain"><img
					src="<s:url value="/images/spacer.gif"/>" /></td>
				<td align="right" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_right_bottom_m.gif"/>" /></td>
			</tr>

		</table>

		<table width="100%" border="0" cellspacing="0" cellpadding="0"
			class="focus">
			<tr height="20px"></tr>
			<tr>
				<td width="7" align="left" valign="top" height="7"><img
					src="<s:url value="/images/corner_left_top_m.gif"/>" width="7"
					height="7" /></td>
				<td class="topBorderMain"><img
					src="<s:url value="/images/spacer.gif" />" /></td>
				<td width="7" align="right" valign="top"><img
					src="<s:url value="/images/corner_right_top_m.gif" />" /></td>
			</tr>

			<tr>

				<th colspan="4" class="mainFormTitle">订单详细_编辑</th>

			</tr>
			<tr>
				<td colspan="5" class="leftRightBorderMain"
					style="border-top-color: black;">
					<table id="radiotable_1" class="mainGrid" width="100%" border="0"
						cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th width="50px">产品</th>
								<th width="50px">单价</th>
								<th width="50px">数量</th>
								<th width="50px">折扣</th>
								<th width="50px">金额</th>
								<th width="180px">编辑 &nbsp <img
									src="<s:url value="/images/btn_add.gif"/>" name="btn_add.gif"
									align="absbottom" /><a href="javascript:doadd()"
									style="font-size: 15px; text-decoration: none;">添加</a></th>
							</tr>
						</thead>
						<c:forEach items="${list}" var="orderDetail" varStatus="i">
							<tr id="radiotable_tr_${i.index}">

								<td align='center' style="word-break: break-all;"><input readonly="readonly"
									id="productName_${i.index}"  onclick="show_childPage_product('${i.index}')"
									name="orderDetails[${i.index }].productName" 
									class="productName" value="${orderDetail.productName}" tag="0">
									
									<input name ="orderDetails[${i.index }].productId" value="${orderDetail.productId}" type="hidden" readonly="readonly" class="productId">
									</td>

								<td align='center' style="word-break: break-all;"><input
									name="orderDetails[${i.index }].productPrice"
									class="productPrice" style="text-align: center; width: 100px;"
									value="${orderDetail.productPrice}" id="productPrice_${i.index}" readonly="readonly"></td>

								<td align='center' style="word-break: break-all;"><input
									style="width: 100px; text-align: center;" class="productNum"
									name="orderDetails[${i.index }].productNum" value="${orderDetail.productNum}"
									id="productNum_${i.index}"></td>

								<td align='center' style="word-break: break-all;"><select
									name="orderDetails[${i.index }].discount"
									id="discount_${i.index}" class="discount"
									style="width: 100px; text-align: center;">
										<option value="1"  <c:if test="${orderDetail.discount=='1'}" >selected</c:if> >&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp无折扣</option>
										<option value="0.8" <c:if test="${orderDetail.discount=='0.8'}" >selected</c:if> >0.8</option>
										<option value="0.9" <c:if test="${orderDetail.discount=='0.9'}" >selected</c:if> >0.9</option>
										<option value="0.95"  <c:if test="${orderDetail.discount=='0.95'}" >selected</c:if>  >0.95</option>
								</select></td>

								<td align='center' style="word-break: break-all;"><input
									name="orderDetails[${i.index }].productCost" readonly="readonly"
									style="text-align: center;" class="productCost" value="${orderDetail.productCost}"
									id="productCost_${i.index}"></td>

								<td align='center' style="word-break: break-all;"><input
									type="button"
									onclick="deleteContact('radiotable_tr_${i.index}')"
									value=" delete " class="button"></td>
							</tr>
						</c:forEach>

					</table> <input type="hidden" value="${fn:length(list)-1}" id="length">
				</td>
			</tr>
			<tr>
				<th colspan="4" class="mainFormbtn" style="height: 30px">
					<table cellpadding="0" cellspacing="0" width="100%">
						<tr>
							<td align="center" style="height: 30px">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="center" style="height: 30px"><div
												class="pageColumn">
												<table width="100%">
													<td align="center"><input type="submit"
														value=" Submit " class="button" onclick="doSubmit()" /><input
														type="button" value=" Back " class="button"
														name="blGo2242" onclick="toBack();" /></td>

												</table>

											</div></td>
									</tr>
								</table>
							</td>
						</tr>
					</table>


				</th>

			</tr>
			<tr>
				<td align="left" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_left_bottom_m.gif"/>" /></td>
				<td class="bottomBorderMain"><img
					src="<s:url value="/images/spacer.gif"/>" /></td>
				<td align="right" valign="bottom" height="7" width="7"><img
					src="<s:url value="/images/corner_right_bottom_m.gif"/>" /></td>
			</tr>
		</table>

	</form:form>

	<script type="text/javascript">
	
	function doSubmit() {
		editForm.action =  "<c:url value='/salesorder/edit' />";
		editForm.submit();
	}
	</script>
</body>
</html>